package com.openbravo.data.loader;

import com.openbravo.basic.BasicException;
import java.util.ArrayList;
import java.util.Date;

public abstract class VectorerBuilder
  implements Vectorer
{
  public abstract String[] getHeaders()
    throws BasicException;

  public String[] getValues(Object paramObject)
    throws BasicException
  {
    SerializableToArray localSerializableToArray = new SerializableToArray();
    ((SerializableWrite)paramObject).writeValues(localSerializableToArray);
    return localSerializableToArray.getValues();
  }

  private static class SerializableToArray
    implements DataWrite
  {
    private ArrayList m_aParams = new ArrayList();

    public void setDouble(int paramInt, Double paramDouble)
      throws BasicException
    {
      ensurePlace(paramInt - 1);
      this.m_aParams.set(paramInt - 1, paramDouble.toString());
    }

    public void setBoolean(int paramInt, Boolean paramBoolean)
      throws BasicException
    {
      ensurePlace(paramInt - 1);
      this.m_aParams.set(paramInt - 1, paramBoolean.toString());
    }

    public void setInt(int paramInt, Integer paramInteger)
      throws BasicException
    {
      ensurePlace(paramInt - 1);
      this.m_aParams.set(paramInt - 1, paramInteger.toString());
    }

    public void setString(int paramInt, String paramString)
      throws BasicException
    {
      ensurePlace(paramInt - 1);
      this.m_aParams.set(paramInt - 1, paramString);
    }

    public void setTimestamp(int paramInt, Date paramDate)
      throws BasicException
    {
      ensurePlace(paramInt - 1);
      this.m_aParams.set(paramInt - 1, paramDate.toString());
    }

    public void setBytes(int paramInt, byte[] paramArrayOfByte)
      throws BasicException
    {
      ensurePlace(paramInt - 1);
      this.m_aParams.set(paramInt - 1, paramArrayOfByte.toString());
    }

    public void setObject(int paramInt, Object paramObject)
      throws BasicException
    {
      ensurePlace(paramInt - 1);
      this.m_aParams.set(paramInt - 1, paramObject.toString());
    }

    private void ensurePlace(int paramInt)
    {
      this.m_aParams.ensureCapacity(paramInt);
      while (paramInt >= this.m_aParams.size())
        this.m_aParams.add(null);
    }

    public String[] getValues()
    {
      return (String[])(String[])this.m_aParams.toArray(new String[this.m_aParams.size()]);
    }
  }
}

/* Location:           D:\PowerFulPOS-2.30.2\openbravopos.jar
 * Qualified Name:     com.openbravo.data.loader.VectorerBuilder
 * JD-Core Version:    0.6.0
 */